﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include("../inc/global.inc");?>
<?php
if($_POST['code']){
   if($_POST['code']==$_SESSION['chkCode']){
      if($_POST[userid]&&$_POST['psw']){
         $rs=@mysql_query("select id,m_psw,m_user,m_jifen2,m_logintime from member where m_user='".$_POST['userid']."'");
		 $row=@mysql_fetch_array($rs);
		    if($row['id']){
			       if($row[m_psw]==substr(md5($_POST['psw']),7,19)){
				    
					  if(date("Y-m-d",strtotime($row['m_logintime']))!=date("Y-m-d")){
					   $m_jifen2=$row['m_jifen2']+1;
				      }else{
					   $m_jifen2=$row['m_jifen2'];
					  }
				    @mysql_query("update member set m_logintime='".date("Y-m-d H:i:s")."',m_jifen2='$m_jifen2' where id='".$row['id']."'");
                      setcookie("user_id",$row["id"]);
				      setcookie("user_name",$row["m_user"]);
					 
				     echo "<script>window.location='/member/'</script>";
				    }else{
					
					echo "<script>alert('密码错误');location='javascript:history.go(-1)';</script>";
					}
		      }else{
			  
			   echo "<script>alert('您的账号错误');location='javascript:history.go(-1)';</script>";
			  }
	  }else{
	       echo "<script>alert('用户名和密码不能为空');location='javascript:history.go(-1)';</script>";
	  }
   }else{
     echo "<script>alert('验证码错误');location='javascript:history.go(-1)';</script>";
   }
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员登录-三帝贸易网</title>
<link href="/css/body.css" rel="stylesheet" type="text/css" />
<link href="/css/head_2.css" rel="stylesheet" type="text/css" />
<link href="/css/foot.css" rel="stylesheet" type="text/css" />
<link href="css/login.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include("../inc/head_top.php")?>
<div class="top1">
<div style="float:left;width:388px;"><a href="/"><img src="/images/logo.gif" alt="三帝贸易网" width="388" height="58" border="0" title="全球网上商品贸易市场"/></a></div>
<div class="onl"></div>
</div>
<div class="onl"></div>
<div id="mian" class="topside6">
<div style="margin-bottom:10px; margin-top:10px;">
<script type="text/javascript">
/*800*45，创建于2013-7-18*/
var cpro_id = "u1322706";
</script>
<script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>
</div>
<div class="title3 size12"><a href="/">首页</a> >> 会员登录</div>
<div class="content size14">
<?php
	$query = mysql_query('select * from `sd_setting` where 1 limit 1');
	$rs = mysql_fetch_array($query);
?>
<div class="left"><a href="<?php echo $rs['url'];?>"><img src="<?php echo $rs['thumb'];?>" width="466" height="197" border="0" /></a>
  <table width="100%" height="88" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td bgcolor="#FEFEFE">
<ul>
<li><h3>免费注册后你即可使用</h3></li>
<li>1. 发布各类商品信息、推荐您的产品、宣传您的公司</li>
<li>2. 发布批发产品</li>
<li>3. 发布代理加盟</li>
<li>4. 发布各类贷款、融资</li>
<li>5. 发布企业人才招聘</li>
<li>6. 发布项目招投标</li>
<li>7. 免费创建企业网站</li>
<li>8. 查看管理留言（采购商留言系统免费手机短讯通知）</li>
<li></li>
<li class="size16 fontred"> 手机浏览网址 m.sandib2b.cn</li>
</ul>
</td>
    </tr>
  </table>
</div>
<div class="right">
  <table width="100%" height="81" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td height="75">&nbsp;</td>
    </tr>
  </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
	<form id="form1" name="form1" method="post" action="../login_in.php" onsubmit="return checkform()">
      <tr>
        <td width="31%" height="45" align="right">用户名</td>
        <td width="69%" height="45"><label>
          <input name="userid" type="text" class="input" id="userid" size="30" maxlength="50" />
        </label></td>
      </tr>
      <tr>
        <td height="45" align="right">密　码</td>
        <td height="45"><input name="psw" type="password" class="input" id="psw" size="30" maxlength="50" /></td>
      </tr>
      <tr>
        <td height="45" align="right">验证码</td>
        <td height="45"><input name="code" id="code" type="text" class="input1" size="8" maxlength="8" />
        &nbsp;<img src="/inc/chk_num.php" align="absmiddle" id="img"/>&nbsp;<a href="#" name="test" id="test">看不清楚？</a></td>
      </tr>
      <tr>
        <td height="40" colspan="2" align="center"><label><a href="/join/index.php?type=1">买家注册</a></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label><a href="/join/forgot_password.php">找回密码？</a></label></td>
        </tr>
      <tr>
        <td height="45" colspan="2" align="center"><label></label>
          <table border="0" cellpadding="0" cellspacing="5">
            <tr>
              <td><input type="image" name="imageField" src="images/but1.gif" />
          </td>
              <td><a href="/join"><img src="images/but2.gif"  border="0" align="absmiddle"/></a></td>
            </tr>
          </table>
          </td>
        </tr></form>
    </table>
  </div>
<div class="onl"></div>
</div>
    <div style="margin-bottom:10px; margin-top:10px;">
        <script type="text/javascript">
    /*800*90，注册页创建于2013-7-18*/
    var cpro_id = "u1322621";
    </script>
    <script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>
    </div>

</div>
<?php include("../inc/foot.php");?>
</body>
</html>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){
if($("userid").value==""){
alert("用户名不能为空");
$("userid").focus();
return false;
}

if($("psw").value==""){
alert("密码不能为空");
$("psw").focus();
return false;
}

if($("code").value==""){
alert("验证码不能为空");
$("code").focus();
return false;
}

}


function test(img){
    var src=img.getAttribute("src");
    src=src+"?new="+Math.random(0,10);
    img.setAttribute("src",src);
}
function prepare(){
    var nav=document.getElementById("test");
    var name=nav.getAttribute("name");
    var str="test";
    if(name==str){
        nav.onclick=function(){
            var img=document.getElementById("img");
            test(img);
            return false;
        }
    }
}
window.onload=prepare;
/*300*250，登陆页创建于2013-7-18*/
var cpro_id = "u1322622";
</script>
<script src="http://cpro.baidustatic.com/cpro/ui/f.js" type="text/javascript"></script>
